home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.4 KB | 36 lines | [TEXT/GEOL] |
- Item 0425720 6-April-88 12:44
-
- From: ROSENSTEIN1 Rosenstein, Larry
-
- To: N0658 ESL, Robert Penland, ASC
-
- cc: MACAPP$ MacApp Interest List
-
- Sub: re MacApp Failure mechanism
-
- A failure handler can do a non-local GOTO to branch back into the main control
- flow. That is what happens in the main event loop of MacApp; if a failure is
- caught, MacApp puts up the alert and branches back into the event loop to get
- the next event.
-
- You must be careful to branch to a point after the Success call, since if the
- failure handler has been called already, then it doesn't need to be removed
- from the failure stack with the Success call.
-
- If you just change the error code in your handler to noErr, then the failure
- will still propagate up the stack, but when it reaches the top, MacApp will
- assume that the error message has already been displayed. In your particular
- case, this is probably not what you want.
-
- You could have OpenAppleTalk return an error code (what it seems to do now), or
- it could just signal failure and assume that the caller will catch the error.
-
- Some programs might require AppleTalk, so an error from OpenAppleTalk should
- cause the program to quit. If you do signal a failure, you should define a
- message value that indicates you were trying to open AppleTalk. You might also
- need strings for the errors that could be returned.
-
- Larry
-
-
-